package cn.wolfcode.web.modules.orderinfo.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import link.ahsj.core.annotations.AddGroup;
import link.ahsj.core.annotations.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author raolejia
 * @since 2022-10-12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TbOrderInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    /**
     * 所属客户id
     */
    @NotBlank(message = "请选择客户",groups = {AddGroup.class, UpdateGroup.class})
    private String custId;

    @TableField(exist = false)
    @Excel(name = "所属客户")
    private String customerName;

    /**
     * 产品名称
     */
    @NotBlank(message = "请输入产品名称",groups = {AddGroup.class, UpdateGroup.class})
    @Length(max = 50, message = "产品名称不能超过50字" ,groups = {AddGroup.class,UpdateGroup.class})
    @Excel(name = "产品名称")
    private String prodName;

    /**
     * 产品数量
     */
    @Excel(name = "产品数量")
    @NotNull(message = "请填写产品数量", groups = {AddGroup.class, UpdateGroup.class})
    private Integer amounts;

    /**
     * 产品价格
     */
    @Excel(name = "产品价格")
    @NotNull(message = "请填写产品价格", groups = {AddGroup.class, UpdateGroup.class})
    private Integer price;

    /**
     * 状态 0 未发货 1 已发货 2 已收货
     */
    @Excel(name = "状态 0 未发货 1 已发货 2 已收货")
    private Integer status;

    /**
     * 收货人
     */
    @NotBlank(message = "请填写收货人",groups = {AddGroup.class, UpdateGroup.class})
    @Length(max = 50, message = "收货人不能超过30字" ,groups = {AddGroup.class,UpdateGroup.class})
    private String receiver;

    @TableField(exist = false)
    @Excel(name = "收货人")
    private String receiverName;

    /**
     * 收货人电话
     */
    @Excel(name = "收货人电话")
    @NotBlank(message = "请输入收货人电话",groups = {AddGroup.class, UpdateGroup.class})
    @Length(max = 20, message = "电话长度不能超过20" ,groups = {AddGroup.class,UpdateGroup.class})
    private String linkPhone;

    /**
     * 收货地址
     */
    @Excel(name = "收货地址")
    @NotBlank(message = "请输入收货地址",groups = {AddGroup.class, UpdateGroup.class})
    private String address;

    /**
     * 物流
     */
    @Excel(name = "物流公司")
    @NotBlank(message = "请输入物流公司",groups = {AddGroup.class, UpdateGroup.class})
    private String logistcs;

    /**
     * 物流单号
     */
    @Excel(name = "物流单号")
    @NotBlank(message = "请输入物流单号",groups = {AddGroup.class, UpdateGroup.class})
    private String logisticsCode;

    /**
     * 发货时间
     */
    @Excel(name = "发货时间")
    private LocalDateTime deliverTime;

    /**
     * 收货时间
     */
    @Excel(name = "收货时间")
    private LocalDateTime receiveTime;
}
